package com.oig.sys.msg.entity;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.io.Serializable;


/**
 * @author wuxl
 * 消息内容表
 */
@Getter
@Setter
@ToString
@Entity
@Table(name = "tb_notice_msg")
@EntityListeners({AuditingEntityListener.class})
public class TbNoticeMsg implements Serializable {

	/**
	 */
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name = "id", nullable = false)
	private Integer id;

	/**
	 */
	@Column(name = "title")
	private String title;

	/**
	 */
	@Column(name = "content")
	private String content;
	/**
	 * 01-系统消息  02-人工通知
	 */
	@Column(name = "msg_source")
	private String msgSource;
	/**
	 * 消息类型 01-定向消息 02-群消息
	 */
	@Column(name = "msg_type")
	private String msgType;
	/**
	 * 推送渠道id
	 */
	@Column(name = "push_channel_id")
	private Integer pushChannelId;
	/**
	 * 推送机器人（渠道名称）
	 */
	@Column(name = "push_channel_name")
	private String pushChannelName;

	/**
	 * 做某些业务产生的消息，记一下业务id
	 */
	@Column(name = "biz_id")
	private String bizId;

	/**
	 * 01-租户全员 02-部门 03-人员
	 */
	@Column(name = "receiver_type")
	private String receiverType;

	/**
	 */
	@Column(name = "receiver_id")
	private Integer receiverId;

	/**
	 */
	@Column(name = "receiver_name")
	private String receiverName;

	/**
	 * 00-草拟 02-待审核 03-驳回 04-生效 
	 */
	@Column(name = "msg_status")
	private String msgStatus;


	/**
	 * 预发布日期
	 */
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "pub_time")
	private java.util.Date pubTime;

	/**
	 */
	@Column(name = "create_user_id")
	private Integer createUserId;

	/**
	 */
	@Column(name = "create_user_name")
	private String createUserName;

	/**
	 */
	@CreatedDate
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "create_time")
	private java.util.Date createTime;

	/**
	 */
	@Column(name = "last_update_id")
	private Integer lastUpdateId;

	/**
	 */
	@Column(name = "last_update_name")
	private String lastUpdateName;

	/**
	 */
	@LastModifiedDate
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "last_update_time")
	private java.util.Date lastUpdateTime;

	/**
	 * 复核时间
	 */
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "check_time")
	private java.util.Date checkTime;

	/**
	 * 复核人id
	 */
	@Column(name = "check_id")
	private Integer checkId;

	/**
	 * 复核人
	 */
	@Column(name = "check_name", length = 32)
	private String checkName;
	@Column(name = "check_remark")
	private String checkRemark;

	/**
	 */
	@Version
	@Column(name = "version")
	private Integer version;

	/**
	 */
	@Column(name = "tenant_id")
	private Integer tenantId;

	/**
	 */
	@Column(name = "tenant_name")
	private String tenantName;


	/**
	 * 发布时间
	 */
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "publisher_time")
	private java.util.Date publisherTime;
	/**
	 * 发布人id
	 */
	@Column(name = "publisher_id")
	private Integer publisherId;
	/**
	 * 发布人
	 */
	@Column(name = "publisher_name", length = 32)
	private String publisherName;

	/**
	 * 外部渠道消息推送次数，默认0
	 */
	@Column(name = "send_times")
	private Integer sendTimes = 0;
}
